# Contributor: Mitsu <archlinux AT suumitsu DOT eu>
# Contributor: Stefan Husmann <stefan-husmann@t-online.de>
# Maintainer: Jelle van der Waa <jelle@archlinux.org>

pkgname=svgcleaner
pkgver=0.9.5
pkgrel=3
pkgdesc="An application that cleans svg images from unnecessary data in batch mode."
arch=('loong64' 'x86_64')
url="https://github.com/RazrFalcon/SVGCleaner"
license=('GPL2')
makedepends=('gcc-libs' 'cargo')
source=("$pkgname-$pkgver.tar.gz::https://github.com/RazrFalcon/SVGCleaner/archive/v${pkgver}.tar.gz"
        Cargo.lock)
sha256sums=('dcf8dbc8939699e2e82141cb86688b6cd09da8cae5e18232ef14085c2366290c'
            '8b69294f77eca465425619b97c0476054fc9726a3744c9f46852a3104b354778')

prepare() {
  cp Cargo.lock "svgcleaner-${pkgver}/"
}

build() {
  cd "svgcleaner-${pkgver}"
  cargo build --release --locked
}

check() {
  cd "svgcleaner-${pkgver}"
  cargo test --release --locked
}

package() {
  cd "svgcleaner-${pkgver}/target/release"
  install -Dm755 "svgcleaner" "${pkgdir}/usr/bin/svgcleaner"
}
